Skip to content

Conversation

@yuce
Copy link
Contributor

@yuce yuce commented Jan 7, 2026

Asyncio client exited early during connection problems.
For example, in the following situation:

  1. Hazelcast cluster has more than one member. Members are able to access each other with their private IPs, but they are accessible by the client only by their public IPs.
  2. The client connects to one of the members using its public IP, without enabling client public address discovery (use_public_ip=True).

In that case, the client must route all invocations to the member it could connect.
This PR fixes that for the asyncio client, by retrying to connect instead of giving up with TargetDisconnectedError.

@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 72.72727% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.61%. Comparing base (e06c30d) to head (a24e85e).

Files with missing lines Patch % Lines
hazelcast/internal/asyncio_reactor.py 75.00% 4 Missing ⚠️
hazelcast/internal/asyncio_connection.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #766      +/-   ##
==========================================
- Coverage   94.62%   94.61%   -0.01%     
==========================================
  Files         393      393              
  Lines       25056    25074      +18     
==========================================
+ Hits        23708    23724      +16     
- Misses       1348     1350       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yuce yuce assigned ihsandemir and unassigned ihsandemir Jan 9, 2026
@yuce yuce requested review from emreyigit and ihsandemir January 9, 2026 08:01
@yuce yuce changed the title Unreachable members fix Improve Asyncio Client's Resiliency Jan 9, 2026
@yuce yuce changed the title Improve Asyncio Client's Resiliency [HZ-5309] Improve Asyncio Client's Resiliency Jan 9, 2026
Copy link
Contributor

@ihsandemir ihsandemir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand from the changes you added a task for reconnect if it fails to connect. But where is the code that will route the invocations to random member connection available? I assumed this would be the fix for the PR. What will we do to test and verify the change?

@yuce
Copy link
Contributor Author

yuce commented Jan 9, 2026

@ihsandemir The invocation logic handles the routing.
If an invocation is directed to a partition, and if there is no active connection to the member that owns the partition, the invocation is sent to a random member.

if invocation.partition_id != -1:

I've manually tested that the scenario works as expected.
Automated testing requires simulating the described scenario, which is to be done after the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants